<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <link rel="stylesheet" type="text/css" href="../res/static/css/main.css">
  <link rel="stylesheet" type="text/css" href="../res/layui/css/layui.css">
  <script type="text/javascript" src="../res/layui/layui.js"></script>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
</head>
<body id="list-cont">
  <div class="site-nav-bg">
    <div class="site-nav w1200">
      <p class="sn-back-home">
        <i class="layui-icon layui-icon-home"></i>
        <a href="#">首页</a>
      </p>
      <div class="sn-quick-menu">
        <div class="login"><a href="login.html">登录</a></div>
        <div class="sp-cart"><a href="shopcart.html">购物车</a><span>2</span></div>
      </div>
    </div>
  </div>


  <div class="header">
    <div class="headerLayout w1200">
      <div class="headerCon">
        <h1 class="mallLogo">
          <a href="#" title="服装商城">
            <img src="../res/static/img/logo2.png" width="200px">
          </a>
        </h1>
        <div class="mallSearch">
          <form action="" class="layui-form" novalidate>
            <input type="text" name="title" required  lay-verify="required" autocomplete="off" class="layui-input" placeholder="请输入需要的商品">
            <button class="layui-btn" lay-submit lay-filter="formDemo">
                <i class="layui-icon layui-icon-search"></i>
            </button>
            <input type="hidden" name="" value="">
          </form>
        </div>
      </div>
    </div>
  </div>


  <div class="content">
    <div class="main-nav">
      <div class="inner-cont0">
        <div class="inner-cont1 w1200">
          <div class="inner-cont2">
            <a href="commodity.html" class="active">所有商品</a>
            <a href="buytoday.html">今日团购</a>
            <a href="information.html">服装资讯</a>
            <a href="about.html">关于我们</a>
          </div>
        </div>
      </div>
    </div>
    <div class="category-con">
      <div class="category-inner-con w1200">
      </div>
      <div class="category-banner">
        <div class="w1200">
          <img src="../res/static/img/n10.jpg" width="1200px" height="480px">
        </div>
      </div>
    </div>
    <div class="floors">
      <div class="sk">
        <div class="sk_inner w1200">
          <div class="sk_hd">
            <a href="javascript:;">
              <img src="../res/static/img/s_img1.jpg">
            </a>
          </div>
          <div class="sk_bd">
            <div class="layui-carousel" id="test1">
              <div id="box" carousel-item>
              </div>
            </div>
          </div>
        </div>    
      </div>
    </div>
    
    






    <div class="hot-recommend-con">
       <div class="hot-con1 w1200 layui-clear">
          <div class="item">
            <h4>热销推荐</h4>
            <div class="big-img">
              <a href="javascript:;"><img src="../res/static/img/g2.jpg" width="350px"></a>
            </div>
            <div class="small-img">
              <a href="javascript:;"><img src="../res/static/img/" alt=""></a>
            </div>
          </div>
          <div class="item">
            <div class="top-img">
              <a href="javascript:;"><img src="../res/static/img/h6.jpg" width="350px" height="280px"></a>
            </div>
            <div class="bottom-img">
              <a href="javascript:;"><img src="../res/static/img/n5.jpg" width="190px"></a>
              <a class="baby-cream" href="javascript:;"><img src="../res/static/img/h4.jpg" width="190px"></a>
            </div>
          </div>
          <div class="item item1 margin0 padding0">
            <a href="javascript:;"><img src="../res/static/img/h1.jpg" width="300px" height="260"></a>
            <a href="javascript:;"><img class="btm-img" src="../res/static/img/h3.jpg" width="300px"height="260"></a>
          </div>
      </div>
    </div>
    


    <div class="product-cont w1200" id="product-cont">
      <div class="product-item product-item1 layui-clear">
        <div class="left-title">
          <h4><i>1F</i></h4>
          <img src="../res/static/img/icon_gou.png">
          <h5>男士服装</h5>
        </div>
        <div class="right-cont">
          <a href="javascript:;" class="top-img"><img src="../res/static/img/hh3.jpg" alt=""></a>
          <div class="img-box">
            <a href="javascript:;"><img src="../res/static/img/n1.jpg" height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/n11.jpg" height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/n2.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/n15.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/n16.jpg"height="200px" width="200px"></a>
          </div>
        </div>
      </div>
      <div class="product-item product-item2 layui-clear">
        <div class="left-title">
          <h4><i>2F</i></h4>
          <img src="../res/static/img/icon_gou.png">
          <h5>女士服装</h5>
        </div>
        <div class="right-cont">
          <a href="javascript:;" class="top-img"><img src="../res/static/img/hh3.jpg" alt=""></a>
          <div class="img-box">
            <a href="javascript:;"><img src="../res/static/img/g1.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/g2.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/g3.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/g5.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/g11.jpg"height="200px" width="200px"></a>
          </div>
        </div>
      </div>
      <div class="product-item product-item3 layui-clear">
        <div class="left-title">
          <h4><i>3F</i></h4>
          <img src="../res/static/img/icon_gou.png">
          <h5>汉服</h5>
        </div>
        <div class="right-cont">
          <a href="javascript:;" class="top-img"><img src="../res/static/img/hh3.jpg" alt=""height="200px" width="1000px"></a>
            <div class="img-box">
            <a href="javascript:;"><img src="../res/static/img/h1.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/h2.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/h3.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/h4.jpg"height="200px" width="200px"></a>
            <a href="javascript:;"><img src="../res/static/img/h6.jpg"height="200px" width="200px"></a>
          </div>
        </div>
      </div>
    </div>

    <div class="product-list-box" id="product-list-box">
      <div class="product-list-cont w1200">
        <h4>更多推荐</h4>
        <div class="product-item-box layui-clear">
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g1.jpg"height="170px" width="200px"></a>
            <p>时尚红色职业装，衬托出自己素质与气质的完美结合！</p>
            <span>￥600.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g2.jpg"height="170px" width="200px"></a>
            <p>时尚女款深蓝色职业服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g3.jpg"height="170px" width="200px"></a>
            <p>时尚服装，曾在巴黎时装周中出现的美丽服装</p>
            <span>￥1000.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g5.jpg"height="170px" width="200px"></a>
            <p>完美总裁，增加自己在职场中的气场</p>
            <span>￥600.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g6.jpg"height="170px" width="200px"></a>
            <p>美丽让霸气的服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
           <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h1.jpg"height="170px" width="200px"></a>
            <p>时尚红色职业装，衬托出自己素质与气质的完美结合！</p>
            <span>￥500.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h2.jpg"height="170px" width="200px"></a>
            <p>时尚女款深蓝色职业服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h3.jpg"height="170px" width="200px"></a>
            <p>时尚服装，曾在巴黎时装周中出现的美丽服装</p>
            <span>￥1000.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h5.jpg"height="170px" width="200px"></a>
            <p>完美总裁，增加自己在职场中的气场</p>
            <span>￥600.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h6.jpg"height="170px" width="200px"></a>
            <p>美丽让霸气的服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g1.jpg"height="170px" width="200px"></a>
            <p>时尚红色职业装，衬托出自己素质与气质的完美结合！</p>
            <span>￥500.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g2.jpg"height="170px" width="200px"></a>
            <p>时尚女款深蓝色职业服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g3.jpg"height="170px" width="200px"></a>
            <p>时尚服装，曾在巴黎时装周中出现的美丽服装</p>
            <span>￥1000.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g5.jpg"height="170px" width="200px"></a>
            <p>完美总裁，增加自己在职场中的气场</p>
            <span>￥600.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g6.jpg"height="170px" width="200px"></a>
            <p>美丽让霸气的服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h1.jpg"height="170px" width="200px"></a>
            <p>时尚红色职业装，衬托出自己素质与气质的完美结合！</p>
            <span>￥500.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h2.jpg"height="170px" width="200px"></a>
            <p>时尚女款深蓝色职业服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h3.jpg"height="170px" width="200px"></a>
            <p>时尚服装，曾在巴黎时装周中出现的美丽服装</p>
            <span>￥1000.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h5.jpg"height="170px" width="200px"></a>
            <p>完美总裁，增加自己在职场中的气场</p>
            <span>￥600.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/h6.jpg"height="170px" width="200px"></a>
            <p>美丽让霸气的服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g1.jpg"height="170px" width="200px"></a>
            <p>时尚红色职业装，衬托出自己素质与气质的完美结合！</p>
            <span>￥500.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g2.jpg"height="170px" width="200px"></a>
            <p>时尚女款深蓝色职业服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g3.jpg"height="170px" width="200px"></a>
            <p>时尚服装，曾在巴黎时装周中出现的美丽服装</p>
            <span>￥1000.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g5.jpg"height="170px" width="200px"></a>
            <p>完美总裁，增加自己在职场中的气场</p>
            <span>￥600.00</span>
          </div>
          <div class="list-item">
            <a href="javascript:;"><img src="../res/static/img/g6.jpg"height="170px" width="200px"></a>
            <p>美丽让霸气的服装，衬托自己不一样的气质</p>
            <span>￥700.00</span>
          </div>
       
        </div>
      </div>
    </div>
  </div>

  <div class="footer">
    <div class="ng-promise-box">
      <div class="ng-promise w1200">
        <p class="text">
          <a class="icon1" href="javascript:;">7天无理由退换货</a>
          <a class="icon2" href="javascript:;">满99元全场免邮</a>
          <a class="icon3" style="margin-right: 0" href="javascript:;">100%品质保证</a>
        </p>
      </div>
    </div>
    <div class="mod_help w1200">                                     
      <p>
        <a href="javascript:;">关于我们</a>
        <span>|</span>
        <a href="javascript:;">帮助中心</a>
        <span>|</span>
        <a href="javascript:;">售后服务</a>
        <span>|</span>
        <a href="javascript:;">服装资讯</a>
        <span>|</span>
        <a href="javascript:;">关于货源</a>
      </p>
      <p class="coty">服装商城版权所有 &copy; 2012-2020</p>
    </div>
  </div>
  <script type="text/javascript">

layui.config({
    base: '../res/static/js/util/' //你存放新模块的目录，注意，不是layui的模块目录
  }).use(['mm','carousel','jquery'],function(){
      var carousel = layui.carousel,
     mm = layui.mm;
      $ = layui.jquery;
      
      //加载今日推荐商品数据
      $.post(
    		  "../../product/findToday.do",
    		  function(res){
    			  //console.log(res)
    			  //解决标题过长的问题
    			  for(var i = 0;i<res.length;i++){
    				  if(res[i].pname.length>16){
    					  res[i].pname=res[i].pname.substring(0,16)+"...";
    				  }
    			  }
    			  var box = $("#box");
    			  var boxone = $('<div class="item-box"></div>');
				  for(var i=0;i<4;i++){
    				  var item = $('<div class="item"><a href="javascript:toDetails('+res[i].id+');"><img src="/file/'+res[i].url+'"></a><div class="title">'+res[i].pname+'</div><div class="price"><span>'+res[i].unitPrice+'</span><del>'+res[i].unitPrice*2+'</del></div></div>');
    				  boxone.append(item);	
				  }
				 
    			  if(res.length>4){//超过4个需要俩box
    				  var boxtwo = $('<div class="item-box"></div>');
    				  for(var i=4;i<res.length;i++){
	    				  var item = $('<div class="item"><a href="javascript:toDetails('+res[i].id+');"><img src="/file/'+res[i].url+'"></a><div class="title">'+res[i].pname+'</div><div class="price"><span>'+res[i].unitPrice+'</span><del>'+res[i].unitPrice*2+'</del></div></div>');
	    				  boxtwo.append(item);
    				  }
    				  
    			  }
    			  box.append(boxone);
    			  box.append(boxtwo);
    			  //console.log(box.html())
    			  carousel.render(option);//渲染
    		  },"json"
      );
      
      
      
      
     var option = {
        elem: '#test1'
        ,width: '100%' //设置容器宽度
        ,arrow: 'always'
        ,height:'298' 
        ,indicator:'none'
      }
      carousel.render(option);
      // 模版引擎导入
     // var ins = carousel.render(option);
     // var html = demo.innerHTML;
     // var listCont = document.getElementById('list-cont');
     // // console.log(layui.router("#/about.html"))
     //  mm.request({
     //    url: '../json/index.json',
     //    success : function(res){
     //      console.log(res)
     //      listCont.innerHTML = mm.renderHtml(html,res)
     //      ins.reload(option);
     //    },
     //    error: function(res){
     //      console.log(res);
     //    }
     //  })
    

});

function toDetails(id){
	//console.log(id)
	location.href="details.html?id="+id;
}
  </script>
</body>
</html>